

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">


<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    
    <title>Installation of PYME on windows with enthought python &mdash; PYME 0.1 documentation</title>
    
    <link rel="stylesheet" href="../_static/default.css" type="text/css" />
    <link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
    
    <script type="text/javascript">
      var DOCUMENTATION_OPTIONS = {
        URL_ROOT:    '../',
        VERSION:     '0.1',
        COLLAPSE_INDEX: false,
        FILE_SUFFIX: '.html',
        HAS_SOURCE:  true
      };
    </script>
    <script type="text/javascript" src="../_static/jquery.js"></script>
    <script type="text/javascript" src="../_static/underscore.js"></script>
    <script type="text/javascript" src="../_static/doctools.js"></script>
    <link rel="top" title="PYME 0.1 documentation" href="../index.html" /> 
  </head>
  <body>
    <div class="related">
      <h3>Navigation</h3>
      <ul>
        <li class="right" style="margin-right: 10px">
          <a href="../genindex.html" title="General Index"
             accesskey="I">index</a></li>
        <li><a href="../index.html">PYME 0.1 documentation</a> &raquo;</li>
<li><a href="http://lmsrv1/docwiki/docs/pyme-docs/Installation/InstallationWindows.rst">Edit</a> &raquo;</li>
 

      </ul>
    </div>  

    <div class="document">
      <div class="documentwrapper">
        <div class="bodywrapper">
          <div class="body">
            
  <div class="section" id="installation-of-pyme-on-windows-with-enthought-python">
<span id="installation"></span><h1>Installation of PYME on windows with enthought python<a class="headerlink" href="#installation-of-pyme-on-windows-with-enthought-python" title="Permalink to this headline">¶</a></h1>
<div class="section" id="prerequisites">
<h2>Prerequisites<a class="headerlink" href="#prerequisites" title="Permalink to this headline">¶</a></h2>
<p>PYME requires python (ideally version 2.7) and a number of additional packages.
The easiest way to get a system up and running is to install the
<a class="reference external" href="http://www.enthought.com/products/epd.php">Enthought Python Distribution</a> (EPD)
which is free for academic use. This has most of the required dependencies, although
a couple will still need to be installed manually. Both 32 bit and 64 bit versions
are available and PYME works with either. If you want to access hardware (e.g. cameras)
and are running 64 bit windows you might need the 64 bit version (I&#8217;ve only tested it
with the 64 bit version). If given the option chose &#8216;install for everyone / all users&#8217;,
rather than doing a personal install. Under Win7/Vista? you might need to right click the EPD
installer and select &#8216;run as administrator&#8217; to do an install for everyone.</p>
<p>After installing EPD, we need to manually install a couple of additional packages.</p>
<div class="section" id="upgrading-wxpython">
<h3>Upgrading wxPython<a class="headerlink" href="#upgrading-wxpython" title="Permalink to this headline">¶</a></h3>
<p>PYME needs wxPython &gt;= 2.8.11. EPD comes with an
older version of wx and we need to remove this before installing the up to date one:</p>
<ul class="simple">
<li>Go to the folder <cite>c:Python27libsite-packages</cite> (or it&#8217;s equivalent if you&#8217;ve
installed python somewhere other than the default location)</li>
<li>remove anything starting with wx</li>
<li>install the new wx which you can download from <a class="reference external" href="http://www.wxpython.org/download.php">http://www.wxpython.org/download.php.</a>
Grab the unicode version which matches your python version.</li>
</ul>
</div>
<div class="section" id="other-dependencies">
<h3>Other Dependencies<a class="headerlink" href="#other-dependencies" title="Permalink to this headline">¶</a></h3>
<p>In addition to wx, PYME needs a couple of other packages which aren&#8217;t in EPD and which
need to be manually installed. Luckily Python comes with a package manager called <tt class="docutils literal"><span class="pre">pip</span></tt>
(or alternatively a slightly older one called <tt class="docutils literal"><span class="pre">easy_install</span></tt> if you don&#8217;t have pip on
your system) which makes this relatively easy if the computer you are using has an
internet connection.</p>
<p>To use <tt class="docutils literal"><span class="pre">pip</span></tt>, open a command prompt and type:</p>
<div class="highlight-python"><pre>pip install &lt;module name&gt;</pre>
</div>
<p>alternatively, using <tt class="docutils literal"><span class="pre">easy_install</span></tt>:</p>
<blockquote>
<div>easy_install &lt;module name&gt;</div></blockquote>
<p>If you don&#8217;t have an internet connection on the computer you&#8217;re trying to install on,
you&#8217;ll have to grab the installers seperately for each module you need. Here google is
your friend and googling &#8220;python &lt;module name&gt;&#8221; will usually get you there pretty quickly.
Once you have an installer, just double click on it to install the module.</p>
<div class="section" id="pyro">
<h4>Pyro<a class="headerlink" href="#pyro" title="Permalink to this headline">¶</a></h4>
<p>There&#8217;s only one required extra module, which is <a class="reference external" href="http://www.xs4all.nl/~irmen/pyro3/">Pyro</a>.
Notably this should be one of the 3.X versions rather than the recently released Pyro4.
<cite>pip install Pyro</cite> should work.</p>
</div>
<div class="section" id="extras">
<h4>Extras<a class="headerlink" href="#extras" title="Permalink to this headline">¶</a></h4>
<p>For full functionality, however, the following are useful:</p>
<ul class="simple">
<li>PyFFTW3 (widefield/confocal deconvolution)</li>
<li>PySerial (interfacing some hardware)</li>
<li>PyParallel (ditto)</li>
<li>MySQL-python (needed for Django and sample database)</li>
<li>Django (&gt;1.2) (sample database)</li>
<li>Delny  (triangle based segmentation)</li>
</ul>
<p>Last time I tried, MySQL-python didn&#8217;t play well with pip/easy_install on windows
and there is no official build for Win7. An unofficial one can be found
<a class="reference external" href="http://www.codegood.com/archives/129">here</a>.
MySQL and Django are only needed for interacting with the sample database, however,
which requires quite a lot of additional setup.</p>
<p>Delny used to be problematic as well, although I think it&#8217;s better in the
current version. If you run into problems I can provide a patched version
which I know ought to work. This is only used in a small measurement component
of the visualisation software, so it can usually be safely ommitted.</p>
<p>It&#8217;s possible that I&#8217;ve also forgotten something, so if PYME complains that it can&#8217;t
find a module, try <a href="#id2"><span class="problematic" id="id3">``</span></a>pip install``ing it.</p>
</div>
</div>
</div>
<div class="section" id="installing-pyme-using-the-installer">
<h2>Installing PYME using the installer<a class="headerlink" href="#installing-pyme-using-the-installer" title="Permalink to this headline">¶</a></h2>
<p>Run the installer and then skip to the basic configuration section below.</p>
</div>
<div class="section" id="installing-pyme-from-source">
<h2>Installing PYME from source<a class="headerlink" href="#installing-pyme-from-source" title="Permalink to this headline">¶</a></h2>
<p>Unzip the code somewhere (I tend to put it directly in <tt class="docutils literal"><span class="pre">c:</span></tt>)</p>
<p>Open a terminal and execute the following:</p>
<div class="highlight-python"><pre>c:
cd c:\PYME
python setup.py develop</pre>
</div>
<p>obviously replacing the path with the relevant one.</p>
<p>After PYME is installed, create shortcuts somewhere (eg the start menu), to the
following scripts:</p>
<ul class="simple">
<li><tt class="docutils literal"><span class="pre">PYME\Acquire\PYMEAquire.py</span></tt> (data acquisition)</li>
<li><tt class="docutils literal"><span class="pre">PYME\ParallelTasks\launchWorkers.py</span></tt> (real time analysis)</li>
<li><tt class="docutils literal"><span class="pre">PYME\DSView\dh5view.cmd</span></tt> (raw data viewer)</li>
<li><tt class="docutils literal"><span class="pre">PYME\Analysis\LMVis\VisGUI.cmd</span></tt> (analysed data viewer)</li>
</ul>
<p>Optionally associate .h5 files with dh5view (will also open .tif,  .kdf &amp; .psf
if you want) and .h5r files with VisGUI. I typically do this by clicking on
one of the files, using the &#8216;Open With&#8217; option, and telling it to remember.
If you&#8217;re using the sample database, you can also associate .pmu files with
<tt class="docutils literal"><span class="pre">PYME\FileUtils\pymeUrlOpener.cmd</span></tt>.</p>
<div class="section" id="pyro-nameserver">
<h3>Pyro Nameserver<a class="headerlink" href="#pyro-nameserver" title="Permalink to this headline">¶</a></h3>
<p>You need to run a <a class="reference external" href="http://www.xs4all.nl/~irmen/pyro3/">Pyro</a> nameserver somewhere
on your network segment. For testing, the easiest thing is to run <tt class="docutils literal"><span class="pre">pryo_ns</span></tt>
(or <tt class="docutils literal"><span class="pre">pyro-nsd</span></tt>) from the command line, or skip this entirely and let PYME launch
one for you. There can, however, only be one
nameserver on the network segment, so long term you might want to find a computer
that&#8217;s always on and run it on that. If it&#8217;s a linux box, there might be some
trickery involved to make sure it binds to the the external interface rather
than localhost (specifically, the hostname has to resolve to the external interface).</p>
</div>
<div class="section" id="basic-configuration">
<span id="basicconfig"></span><h3>Basic Configuration<a class="headerlink" href="#basic-configuration" title="Permalink to this headline">¶</a></h3>
<p>In addition to the setup detailed above, PYME has a couple of configuration options
which are controlled by environment variables. These are:</p>
<table border="1" class="docutils">
<colgroup>
<col width="24%" />
<col width="76%" />
</colgroup>
<tbody valign="top">
<tr class="row-odd"><td>PYMEDATADIR</td>
<td>Default location where PYMEAcquire saves data. Eg
<tt class="docutils literal"><span class="pre">D:\</span></tt>. Also place where other parts of analysis
chain look for data.</td>
</tr>
<tr class="row-even"><td>PYMEMICRPATH</td>
<td>Used with sample database to know where (on the local
machine) the microscope computer is mapped. Not relevant
unless you&#8217;re using the sample information database.</td>
</tr>
<tr class="row-odd"><td>PYMENASPATH</td>
<td>As for PYMEMICRPATH, but for the NAS</td>
</tr>
</tbody>
</table>
<p>You probably want to set at least PYMEDATADIR, as the default is not
particularly useful.</p>
<p>You should now have a setup which works for simulation*,
data analysis, &amp; visualisation. Interfacing with hardware
requires a little more work - see <a class="reference internal" href="../ConfiguringPYMEAcquire.html#configuringpymeacquire"><em>Configuring PYME Acquire</em></a>.</p>
<p>* simulation probably won&#8217;t work perfectly until you&#8217;ve done the
EMGain calibration section of <a class="reference internal" href="../ConfiguringPYMEAcquire.html#configuringpymeacquire"><em>Configuring PYME Acquire</em></a>.</p>
</div>
</div>
</div>


          </div>
        </div>
      </div>
      <div class="sphinxsidebar">
        <div class="sphinxsidebarwrapper">
  <h3><a href="../index.html">Table Of Contents</a></h3>
  <ul>
<li><a class="reference internal" href="#">Installation of PYME on windows with enthought python</a><ul>
<li><a class="reference internal" href="#prerequisites">Prerequisites</a><ul>
<li><a class="reference internal" href="#upgrading-wxpython">Upgrading wxPython</a></li>
<li><a class="reference internal" href="#other-dependencies">Other Dependencies</a><ul>
<li><a class="reference internal" href="#pyro">Pyro</a></li>
<li><a class="reference internal" href="#extras">Extras</a></li>
</ul>
</li>
</ul>
</li>
<li><a class="reference internal" href="#installing-pyme-using-the-installer">Installing PYME using the installer</a></li>
<li><a class="reference internal" href="#installing-pyme-from-source">Installing PYME from source</a><ul>
<li><a class="reference internal" href="#pyro-nameserver">Pyro Nameserver</a></li>
<li><a class="reference internal" href="#basic-configuration">Basic Configuration</a></li>
</ul>
</li>
</ul>
</li>
</ul>

  <h3>This Page</h3>
  <ul class="this-page-menu">
    <li><a href="../_sources/Installation/InstallationWindows.txt"
           rel="nofollow">Show Source</a></li>
  </ul>
<div id="searchbox" style="display: none">
  <h3>Quick search</h3>
    <form class="search" action="../search.html" method="get">
      <input type="text" name="q" />
      <input type="submit" value="Go" />
      <input type="hidden" name="check_keywords" value="yes" />
      <input type="hidden" name="area" value="default" />
    </form>
    <p class="searchtip" style="font-size: 90%">
    Enter search terms or a module, class or function name.
    </p>
</div>
<script type="text/javascript">$('#searchbox').show(0);</script>
        </div>
      </div>
      <div class="clearer"></div>
    </div>
    <div class="related">
      <h3>Navigation</h3>
      <ul>
        <li class="right" style="margin-right: 10px">
          <a href="../genindex.html" title="General Index"
             >index</a></li>
        <li><a href="../index.html">PYME 0.1 documentation</a> &raquo;</li>
<li><a href="http://lmsrv1/docwiki/docs/pyme-docs/Installation/InstallationWindows.rst">Edit</a> &raquo;</li>
 

      </ul>
    </div>
    <div class="footer">
        &copy; Copyright 2010, David Baddeley.
      Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.1.3.
    </div>
  </body>
</html>